//
//  HZ_TwotableViewCell.m
//  HZ_Beautiful_Music
//
//  Created by dllo on 16/4/5.
//  Copyright © 2016年 ui. All rights reserved.
//

#import "HZ_TwotableViewCell.h"
#import "UIImageView+WebCache.h"
@interface HZ_TwotableViewCell ()


@property (nonatomic, strong) UILabel *sortlabel;
@property (nonatomic, strong) UILabel *Musicnamelabel;
@property (nonatomic, strong) UILabel *namellabel;
@property (nonatomic, strong) UILabel *lovelabel;
@property (nonatomic, strong) UILabel *qualitylabel;
@property (nonatomic, strong) UIImageView *Pictureimage;
@property (nonatomic, strong) UIImageView *loveimage;
@property (nonatomic, strong) UIImageView *playimage;


@end
@implementation HZ_TwotableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self =  [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        
        self.backgroundColor = [UIColor whiteColor];
        
        
        self.Pictureimage = [[UIImageView alloc] init];
        
//        self.Pictureimage.backgroundColor = [UIColor colorWithRed:1.000 green:0.281 blue:0.599 alpha:1.000];
        
        [self.contentView addSubview:self.Pictureimage];
        
        self.Musicnamelabel = [[UILabel alloc] init];
        
        
//        self.Musicnamelabel.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.Musicnamelabel];
        
        
        
        
        self.namellabel = [[UILabel alloc] init];
        
        
//        self.namellabel.backgroundColor = [UIColor purpleColor];
        [self.contentView addSubview:self.namellabel];
        
        self.playimage = [[UIImageView alloc] init];
        
        self.playimage.image = [UIImage imageNamed:@"iconfont-bofang-3"];
//        self.playimage.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.playimage];

        
        
        
    }

    return self;
    
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.Pictureimage.frame = CGRectMake(10, self.bounds.size.height / 7, 4 * self.bounds.size.height / 6, 5 * self.bounds.size.height / 7);
    
    self.Musicnamelabel.frame = CGRectMake(  self.Pictureimage.bounds.size.width + 15, self.Pictureimage.frame.origin.y,  4 * self.bounds.size.width / 8, self.Pictureimage.bounds.size.height / 2);
    self.namellabel.frame = CGRectMake(self.Musicnamelabel.frame.origin.x, self.Pictureimage.frame.origin.y + self.Pictureimage.bounds.size.height / 2, 4 * self.bounds.size.width / 8, self.Pictureimage.bounds.size.height / 2);
    
    self.playimage.frame = CGRectMake(7 * self.bounds.size.width / 8, self.bounds.size.height / 2 - self.bounds.size.width / 16,  self.bounds.size.width / 8,  self.bounds.size.width / 8);
    
}

-(void)setModel:(HZ_DataArray_Model *)model{
    
    _model = model;
    
    
    [self.Pictureimage sd_setImageWithURL:[NSURL URLWithString:_model.small_pic_url]];
    
    self.Musicnamelabel.text = _model.tag_name;
    
    NSString *str = [NSString stringWithFormat:@"试听热度:%ld", _model.listen_count];
    
    self.namellabel.text = str;
    
    
    
    
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
